package com.rory.gooday.task;

import com.rory.gooday.common.model.Task;
import com.jfinal.plugin.activerecord.Page;

public class TaskService {

	private final Task taskDao = new Task().dao();

	public Page<Task> paginate(int pageNumber, int pageSize) {
		Page<Task> b = taskDao.paginate(pageNumber, pageSize, "SELECT *", "FROM task WHERE 1 = 1 ORDER BY task_time DESC, important DESC,flag ASC, id DESC");
		return b;
	}
	
	public Task findById(int id) {
		return taskDao.findById(id);
	}

	public void deleteById(int id) {
		taskDao.deleteById(id);
	}
}
